perm filename 106A34[1,RWF] blob sn#730233 filedate 1983-11-10 generic text, type C, neo UTF8
COMMENT āŠ—   VALID 00002 PAGES
C REC  PAGE   DESCRIPTION
C00001 00001
C00002 00002	Coordinates
C00006 ENDMK
CāŠ—;
Coordinates

In drawing graphs of functions of one variable, it is customary to use the
horizontal dimension to represent the independent variable, usually called
x, increasing from left to right.  The vertical dimension represents the
dependent variable, usually called y, increasing from bottom to top.  We
will call such coordinate systems graph coordinates.  In graph coordinates,
the points shown below have the coordinate pairs written next to them.
























It is customary to identify array elements, however, by a different convention,
as shown by the example below:

	A11	A12	A13	A14

	A21	A22	A23	A24

	A31	A32	A33	A34

Here the first coordinate, often called i, is vertical and increases from top
to bottom; the second, often called j, is horizontal, and increases from left
to right.  We will call such coordinate systems array coordinates.  Also, in
array coordinates, the coordinates usually refer to the squares of the grid,
rather than the corners.  In an array coordinate system, the shaded squares
shown below have the coordinates shown next to them.
























Comparing the two illustrations, notice that the shift between array and graph
coordinates roughly corresponds to a 90 degree rotation of the image.

In computing, it is customary to use array coordinates in referring to arrays
and to input and output pages.  In this text, we usually use R (for row) as
the vertical coordinate, and C (for column) as the horizontal on the printed
page.  Array coordinates correspond to the order in which most computer
printers print the characters on the page, with lines from top to bottom 
and characters left to right within the line.  A procedure call to put an
asterisk as character 9 of line 5 of a page will normally be P('*',9,5).  
Your programs will usually be most intelligible to other readers if you
follow this convention.  Your typical page printing operation will be:

	FOR R:=1 TO 60 DO
		BEGIN
		FOR C:=1 TO 132 DO
			WRITE(IMAGE[R,C]);
		WRITELN
		END